<?php
namespace frontend\controllers;

use yii;
use yii\web\Controller;
use frontend\models\Lottery;
class LotteryController extends Controller
	{
       public function actionShow()
       {  
         $t = isset($_GET['t']) ? $_GET['t'] :3;

        //关联表名 注意大小写   查询字段   asArray()转为数组 否则是对象               
        $data = Lottery::find()->joinWith(['type'])->select('*')->where("lottery.t_id = ".$t)->asArray()->all();
        return $this->render('show', [
                'data' => $data,
            ]);
        
       	 
       }
	}